
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * AIUI.java
 *
 * Created on 29 יוני 2009, 22:13
 */
/**
 *
 * @author  רוני וגלית להב
 */
public class AIUI extends javax.swing.JFrame {

    public static int maxGradePossible;
    public static SearchResultsProvider searchResults = SearchResultsProvider.Instance;
    public static Equation eq = null;
    private boolean generated = false;
    private boolean running = false;
    private GeneticAlgo ga;
    private RandomHillClimb hc;
    private boolean GeneticClimbing = false;

    /** Creates new form AIUI */
    public AIUI() {
        initComponents();
    }

    public static int getMaxPossibleGrade() {
        return maxGradePossible;
    }

    private boolean refreshHCGraph(SearchResultsItem result) {
        //Should change to getResult() when used in seperate thread
        if (result == null) {
            return false;
        }

        txtHCBestGrade.setText(Integer.toString(result.getBestGrade()));
        txtHCBestVec.setText(result.getBestVector().toString());
        txtHCElapsedTime.setText(Long.toString(result.getBestTime()));
        txtHCNodesCount.setText(Long.toString(result.getNodesCount()));
        ((GraphPanel) jpnlHCGraph).addResult(Integer.parseInt(txtHCBestGrade.getText()));
        return true;
    }

    private boolean refreshGAGraph(SearchResultsItem result) {

        if (result == null) {
            return false;
        }
        txtGABestGrade.setText(Integer.toString(result.getBestGrade()));
        txtGABestVec.setText(result.getBestVector().toString());
        txtGAElapsedTime.setText(Long.toString(result.getBestTime()));
        txtGANodesCount.setText(Long.toString(result.getNodesCount()));
        ((GraphPanel) jpnlGAGraph).addResult(Integer.parseInt(txtGABestGrade.getText()));
        return true;
    }

    private String createTimeFormat(long milis) {
        String time = ":" + Long.toString(milis % 1000); //milliseconds
        milis = milis / 1000;
        time = ":" + Long.toString(milis % 60) + time; //seconds
        time = Long.toString(milis / 60) + time; //minutes
        return time;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        txtClauses = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        txtVars = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        txtHCRandRestart = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        txtHCReacurData = new javax.swing.JTextField();
        txtGAPM = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        txtGAPC = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        txtGAPopSize = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        txtGAMaxCycles = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jToggleButton1 = new javax.swing.JToggleButton();
        btnGenerate = new javax.swing.JButton();
        btnRun = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        txtHCBestGrade = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        txtHCMaxGrade = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        txtHCBestVec = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        txtHCElapsedTime = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        txtHCNodesCount = new javax.swing.JTextField();
        jpnlHCGraph = new GraphPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        txtGANodesCount = new javax.swing.JTextField();
        txtGABestVec = new javax.swing.JTextField();
        txtGAMaxGrade = new javax.swing.JTextField();
        txtGABestGrade = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        txtGAElapsedTime = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jpnlGAGraph = new GraphPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("AI Searching in 3SAT - Hill Climbing with Random Restart VS Genetic Algorithm");
        setName("AIUI"); // NOI18N
        setResizable(false);

        jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanel1.setName("pne3SATData"); // NOI18N

        jLabel1.setFont(new java.awt.Font("Arial", 1, 11));
        jLabel1.setText("3SAT Vars:");

        jLabel2.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel2.setText("Random Restart Threshold");

        jLabel3.setFont(new java.awt.Font("Arial", 1, 11));
        jLabel3.setText("Hill Climbing Vars:");

        jLabel4.setFont(new java.awt.Font("Arial", 1, 11));
        jLabel4.setText("Genetic Algo. Vars:");

        jLabel5.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel5.setText("Clauses");

        txtClauses.setText("10");
        txtClauses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtClausesActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel6.setText("Variables");

        txtVars.setText("8");

        jLabel7.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel7.setText("Mutation Probability");

        txtHCRandRestart.setText("10");

        jLabel8.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel8.setText("Reacurring Data Threshold");

        txtHCReacurData.setText("5");

        txtGAPM.setText("0.3");

        jLabel9.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel9.setText("Crossover Probability");

        txtGAPC.setText("0.7");

        jLabel10.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel10.setText("Population Size");

        txtGAPopSize.setText("20");

        jLabel12.setFont(new java.awt.Font("Arial", 0, 11));
        jLabel12.setText("Maximum Cycles");

        txtGAMaxCycles.setText("50");

        jButton1.setText("Quick Run");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jToggleButton1.setText("Genetic Climbing");
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtClauses, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtVars, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 319, Short.MAX_VALUE)
                        .addComponent(jButton1))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtHCRandRestart, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtHCReacurData, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 98, Short.MAX_VALUE)
                                .addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtGAPM, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtGAPC, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtGAPopSize, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel12)
                                .addGap(4, 4, 4)
                                .addComponent(txtGAMaxCycles, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(10, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtClauses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVars, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCRandRestart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCReacurData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jToggleButton1))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel7)
                    .addComponent(txtGAPM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(txtGAPC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(txtGAPopSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(txtGAMaxCycles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        btnGenerate.setText("Generate");
        btnGenerate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGenerateActionPerformed(evt);
            }
        });

        btnRun.setText("Run");
        btnRun.setEnabled(false);
        btnRun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRunActionPerformed(evt);
            }
        });

        jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel13.setFont(new java.awt.Font("Arial", 1, 11));
        jLabel13.setText("Hill Climbing");

        jLabel15.setText("Best Grade yet");

        txtHCBestGrade.setEditable(false);
        txtHCBestGrade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHCBestGradeActionPerformed(evt);
            }
        });

        jLabel16.setText("Out of max theoretically possible");

        txtHCMaxGrade.setEditable(false);
        txtHCMaxGrade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHCMaxGradeActionPerformed(evt);
            }
        });

        jLabel17.setText("Best Result Vector yet");

        txtHCBestVec.setEditable(false);
        txtHCBestVec.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHCBestVecActionPerformed(evt);
            }
        });

        jLabel18.setText("Elapsed Time till best result");

        txtHCElapsedTime.setEditable(false);
        txtHCElapsedTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHCElapsedTimeActionPerformed(evt);
            }
        });

        jLabel19.setText("Milliseconds");

        jLabel20.setText("Amount of Nodes till best result");

        txtHCNodesCount.setEditable(false);
        txtHCNodesCount.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtHCNodesCountActionPerformed(evt);
            }
        });

        jpnlHCGraph.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        javax.swing.GroupLayout jpnlHCGraphLayout = new javax.swing.GroupLayout(jpnlHCGraph);
        jpnlHCGraph.setLayout(jpnlHCGraphLayout);
        jpnlHCGraphLayout.setHorizontalGroup(
            jpnlHCGraphLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 436, Short.MAX_VALUE)
        );
        jpnlHCGraphLayout.setVerticalGroup(
            jpnlHCGraphLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 286, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(192, 192, 192)
                    .addComponent(jLabel13))
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel15)
                    .addGap(18, 18, 18)
                    .addComponent(txtHCBestGrade, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel16)
                    .addGap(18, 18, 18)
                    .addComponent(txtHCMaxGrade, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel17)
                    .addGap(18, 18, 18)
                    .addComponent(txtHCBestVec)))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel20)
                    .addComponent(jLabel18))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtHCNodesCount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                    .addComponent(txtHCElapsedTime, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel19))
            .addComponent(jpnlHCGraph, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCBestGrade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCMaxGrade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCBestVec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCElapsedTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHCNodesCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jpnlHCGraph, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel14.setFont(new java.awt.Font("Arial", 1, 11));
        jLabel14.setText("Genetic Algo");

        txtGANodesCount.setEditable(false);
        txtGANodesCount.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGANodesCountActionPerformed(evt);
            }
        });

        txtGABestVec.setEditable(false);
        txtGABestVec.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGABestVecActionPerformed(evt);
            }
        });

        txtGAMaxGrade.setEditable(false);
        txtGAMaxGrade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGAMaxGradeActionPerformed(evt);
            }
        });

        txtGABestGrade.setEditable(false);
        txtGABestGrade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGABestGradeActionPerformed(evt);
            }
        });

        jLabel23.setText("Best Result Vector yet");

        jLabel22.setText("Out of max theoretically possible");

        jLabel24.setText("Elapsed Time till best result");

        jLabel26.setText("Amount of Nodes till best result");

        jLabel25.setText("Milleseconds");

        txtGAElapsedTime.setEditable(false);
        txtGAElapsedTime.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGAElapsedTimeActionPerformed(evt);
            }
        });

        jLabel21.setText("Best Grade yet");

        jpnlGAGraph.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        javax.swing.GroupLayout jpnlGAGraphLayout = new javax.swing.GroupLayout(jpnlGAGraph);
        jpnlGAGraph.setLayout(jpnlGAGraphLayout);
        jpnlGAGraphLayout.setHorizontalGroup(
            jpnlGAGraphLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 449, Short.MAX_VALUE)
        );
        jpnlGAGraphLayout.setVerticalGroup(
            jpnlGAGraphLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 286, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(187, 187, 187)
                .addComponent(jLabel14))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel21)
                            .addGap(18, 18, 18)
                            .addComponent(txtGABestGrade, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jLabel22)
                            .addGap(18, 18, 18)
                            .addComponent(txtGAMaxGrade, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel23)
                            .addGap(18, 18, 18)
                            .addComponent(txtGABestVec)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel26)
                            .addComponent(jLabel24))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtGANodesCount, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                            .addComponent(txtGAElapsedTime, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel25))))
            .addComponent(jpnlGAGraph, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGABestGrade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGAMaxGrade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGABestVec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGAElapsedTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGANodesCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jpnlGAGraph, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(39, 39, 39)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnRun, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnGenerate, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnGenerate, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnRun, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtClausesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtClausesActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtClausesActionPerformed

    private void txtHCBestGradeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHCBestGradeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHCBestGradeActionPerformed

    private void txtHCMaxGradeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHCMaxGradeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHCMaxGradeActionPerformed

    private void txtHCBestVecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHCBestVecActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHCBestVecActionPerformed

    private void txtHCElapsedTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHCElapsedTimeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHCElapsedTimeActionPerformed

    private void txtHCNodesCountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHCNodesCountActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtHCNodesCountActionPerformed

    private void txtGABestGradeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGABestGradeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGABestGradeActionPerformed

    private void txtGAMaxGradeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGAMaxGradeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGAMaxGradeActionPerformed

    private void txtGABestVecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGABestVecActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGABestVecActionPerformed

    private void txtGAElapsedTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGAElapsedTimeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGAElapsedTimeActionPerformed

    private void txtGANodesCountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGANodesCountActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGANodesCountActionPerformed

private void btnGenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateActionPerformed
    generate();
}//GEN-LAST:event_btnGenerateActionPerformed

    private void generate() {
        btnRun.setEnabled(false);
        //Need to create new searching objects for each re-generation of problem (in case settings changed etc...)
        if (!running) {
            eq = new Equation(AISearching.CreateCNF.randInstance(Integer.parseInt(txtClauses.getText()), Integer.parseInt(txtVars.getText())));
            generated = true;
            ((GraphPanel) jpnlHCGraph).setMaxFit(Integer.parseInt(txtClauses.getText()));
            ((GraphPanel) jpnlGAGraph).setMaxFit(Integer.parseInt(txtClauses.getText()));
            ((GraphPanel) jpnlHCGraph).setGenerations((Integer.parseInt(txtClauses.getText()) * Integer.parseInt(txtVars.getText()) * Integer.parseInt(txtHCRandRestart.getText()) * Integer.parseInt(txtHCReacurData.getText())) / 10);
            ((GraphPanel) jpnlGAGraph).setGenerations((Integer.parseInt(txtGAPopSize.getText()) * Integer.parseInt(txtGAMaxCycles.getText())) / 10);

        }
        btnRun.setEnabled(true);
    }

    @SuppressWarnings("empty-statement")
private void btnRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRunActionPerformed
        run();
}//GEN-LAST:event_btnRunActionPerformed

    private void runInit() {
        initVars();
        searchResults.ClearQue();
        ga = new GeneticAlgo(Integer.parseInt(txtGAPopSize.getText()), Double.parseDouble(txtGAPC.getText()), Double.parseDouble(txtGAPM.getText()), Integer.parseInt(txtVars.getText()), Integer.parseInt(txtGAMaxCycles.getText()));
        hc = new RandomHillClimb(Integer.parseInt(txtVars.getText()));
    }

    @SuppressWarnings("empty-statement")
    private void run() {
        runInit();
        try {

            if (GeneticClimbing) {
                maxGradePossible = (int) ((double) maxGradePossible * 0.90);
                ga.run();
                BitVector vec = searchResults.getLastResult().getBestVector();                
                while (this.refreshGAGraph(searchResults.getResult()));

                GraphPanel t = (GraphPanel) jPanel3.getComponents()[12];
                t.setResults(((GraphPanel) jpnlGAGraph).getResults());
                t.setGenerations(((GraphPanel) jpnlGAGraph).getResults().size());
                t.setMaxFit(Integer.parseInt(txtClauses.getText()));
                jPanel3.paintAll(jPanel3.getGraphics());

                hc.Climb(1, Integer.parseInt(txtHCReacurData.getText()), vec);                
                while (this.refreshHCGraph(searchResults.getResult()));

                t = (GraphPanel) jPanel2.getComponents()[12];
                t.setResults(((GraphPanel) jpnlHCGraph).getResults());
                t.setGenerations(((GraphPanel) jpnlHCGraph).getResults().size());
                t.setMaxFit(Integer.parseInt(txtClauses.getText()));
                jPanel2.paintAll(jPanel2.getGraphics());
            } 
            else {
                hc.Climb(Integer.parseInt(txtHCRandRestart.getText()), Integer.parseInt(txtHCReacurData.getText()));
                while (this.refreshHCGraph(searchResults.getResult()));

                GraphPanel t = (GraphPanel) jPanel2.getComponents()[12];
                t.setResults(((GraphPanel) jpnlHCGraph).getResults());
                t.setGenerations(((GraphPanel) jpnlHCGraph).getResults().size());
                t.setMaxFit(Integer.parseInt(txtClauses.getText()));
                jPanel2.paintAll(jPanel2.getGraphics());

                //this.searchResults.Instance.ClearQue();
                ga.run();
                while (this.refreshGAGraph(searchResults.getResult()));
                t = (GraphPanel) jPanel3.getComponents()[12];
                t.setResults(((GraphPanel) jpnlGAGraph).getResults());
                t.setGenerations(((GraphPanel) jpnlGAGraph).getResults().size());
                t.setMaxFit(Integer.parseInt(txtClauses.getText()));
                jPanel3.paintAll(jPanel3.getGraphics());
            }
        } catch (IllegalAccessException ex) {
            Logger.getLogger(AIUI.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        FileWriter out = null;
        try {
            out = new FileWriter("outputCSV.csv");
            out.write("Run, Best Time HC, Nodes HC, Best Grade HC, Best Time GA, Nodes GA,Best Grade GA\n");
            for (int i = 1; i <= 30; i += 2) {
                generate();
                for (int j = 0; j < 2; j++) {

                    runInit();
                    if (!GeneticClimbing) {
                        long HCtime = System.currentTimeMillis();
                        hc.Climb(Integer.parseInt(txtHCRandRestart.getText()), Integer.parseInt(txtHCReacurData.getText()));
                        HCtime = System.currentTimeMillis() - HCtime;
                        refreshHCGraph(searchResults.getLastResult());
                        long GAtime = System.currentTimeMillis();
                        ga.run();
                        GAtime = System.currentTimeMillis() - GAtime;
                        refreshGAGraph(searchResults.getLastResult());
                    } else {


                        maxGradePossible = (int) ((double) maxGradePossible * 0.90);
                        ga.run();
                        BitVector vec = searchResults.getLastResult().getBestVector();
                        refreshGAGraph(searchResults.getLastResult());
                        searchResults.ClearQue();
                        hc.Climb(1, Integer.parseInt(txtHCReacurData.getText()), vec);
                        refreshHCGraph(searchResults.getLastResult());
                    }
                    out.write(i + j + "," +
                            //HCtime + "," +
                            "\"" + txtHCElapsedTime.getText() + "\"" + "," + txtHCNodesCount.getText() + "," + txtHCBestGrade.getText() + "," +
                            //GAtime + "," +
                            "\"" + txtGAElapsedTime.getText() + "\"" + "," + txtGANodesCount.getText() + "," + txtGABestGrade.getText() + "\n");

                }
            }
        } catch (IllegalAccessException ex) {
            Logger.getLogger(AIUI.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(AIUI.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                out.close();
            } catch (IOException ex) {
                Logger.getLogger(AIUI.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }//GEN-LAST:event_jButton1ActionPerformed

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
        if (GeneticClimbing) {
            GeneticClimbing = false;
        } else {
            GeneticClimbing = true;
        }
    }//GEN-LAST:event_jToggleButton1ActionPerformed

    private void initVars() {
        maxGradePossible = Integer.parseInt(txtClauses.getText());
        txtHCMaxGrade.setText(txtClauses.getText());
        txtGAMaxGrade.setText(txtClauses.getText());
        txtHCBestGrade.setText("");
        txtGABestGrade.setText("");
        txtHCBestVec.setText("");
        txtGABestVec.setText("");
        txtHCElapsedTime.setText("");
        txtGAElapsedTime.setText("");
        txtHCNodesCount.setText("");
        txtGANodesCount.setText("");
        jpnlHCGraph = new GraphPanel();
        jpnlGAGraph = new GraphPanel();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new AIUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnGenerate;
    private javax.swing.JButton btnRun;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JPanel jpnlGAGraph;
    private javax.swing.JPanel jpnlHCGraph;
    private javax.swing.JTextField txtClauses;
    private javax.swing.JTextField txtGABestGrade;
    private javax.swing.JTextField txtGABestVec;
    private javax.swing.JTextField txtGAElapsedTime;
    private javax.swing.JTextField txtGAMaxCycles;
    private javax.swing.JTextField txtGAMaxGrade;
    private javax.swing.JTextField txtGANodesCount;
    private javax.swing.JTextField txtGAPC;
    private javax.swing.JTextField txtGAPM;
    private javax.swing.JTextField txtGAPopSize;
    private javax.swing.JTextField txtHCBestGrade;
    private javax.swing.JTextField txtHCBestVec;
    private javax.swing.JTextField txtHCElapsedTime;
    private javax.swing.JTextField txtHCMaxGrade;
    private javax.swing.JTextField txtHCNodesCount;
    private javax.swing.JTextField txtHCRandRestart;
    private javax.swing.JTextField txtHCReacurData;
    private javax.swing.JTextField txtVars;
    // End of variables declaration//GEN-END:variables
}
